// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import VueRouter from 'vue-router'
import App from './App' 
import routes from './router' //路由数据
import ElementUI from 'element-ui'
import axios from 'axios' // 处理http请求

import store from './store' // 状态管理
//import 'element-ui/lib/theme-default/index.css'

import moment from 'moment'//时间过滤器
Vue.prototype.moment = moment
import '../static/js/time.js';
//geturl

import geturlpara from '../static/js/geturlpara.js';
Vue.prototype.$geturlpara = geturlpara 
//验证
var VueValidator=require("vue-validator");
Vue.use(VueValidator);

require('./assets/common.scss')
import Mint from 'mint-ui'
import 'mint-ui/lib/style.css'//MintUI

// import VIscroll from 'viscroll';//滚动
Vue.use(VueRouter)
Vue.use(ElementUI)


//接口默认地址
//axios.defaults.baseURL = 'http://fq.fjyousun.com/api';
axios.defaults.baseURL = 'http://yczhsa.gov.cn/api';
//post请求 默认加报头
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';

Vue.config.productionTip = false

// export路由
export const router = new VueRouter({
  routes  
  // mode: 'hash', //可选参数 hash history
  // linkActiveClass: 'active' // 选中界面添加active
});

// router.beforeEach((to, from, next) => {
//   if (to.matched.some(record => record.meta.requiresAuth)) {
//     let auth = JSON.parse(localStorage.getItem('auth'));
//     if (!auth) {
//       next({
//         path: '/login',
//         query: {
//           redirect: to.fullPath
//         }
//       });
//     }
//   }
//   next();
// });

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  Mint,
  template: '<App/>',
  components: { App }
})


